var express = require("express");
var app = express();
var router = require("./controller");

app.set("view engine","ejs"); // 模板引擎

app.use(express.static("./public"));    // 路由中间件 静态页面
app.use(express.static("./uploads")); 

app.get("/",router.showIndex);  // 首页
app.get("/:albumName",router.showAlbum);
app.get("/up",router.showUp);
app.post("/up",router.doPost);

// 前面都不匹配 就呈现404 要放在最后、
app.use(function(req,res){
    res.render("err");
})

app.listen(3000);